﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PCManager_V0._1.linq;

namespace PCManager_V0._1
{
    public partial class PowerFuncUC : UserControl
    {
        private const string POWER_OPTIONS_ID = "ID";
        private const string POWER_OPTIONS_TEXT = "Text";
        public PowerFuncUC()
        {
            InitializeComponent();
        }

        private void PowerFuncUC_Load(object sender, EventArgs e) {
            InitData();
        }

        private void InitData() {
            InitCbxPowerOptions();
        }

        private void InitCbxPowerOptions() {
            PCManagerDataContext dc = new PCManagerDataContext();
            var powerOptions = dc.GetTable(typeof(PowerOption));
            m_cbxPowerOptions.DataSource = powerOptions;
            m_cbxPowerOptions.ValueMember = POWER_OPTIONS_ID;
            m_cbxPowerOptions.DisplayMember = POWER_OPTIONS_TEXT;
        }
    }
}
